
correlations <- data.frame(
  "Question" = c("Connectedness", "Outsider", "Future", "Isolated", "Read", "Speak", "Write", 
                 "Listen", "Income", "Employment", "Expenses", "Empl. Satisfaction", 
                 "Understanding", "Discuss", "Pol. Quiz", "Pol. Action", "Dinner", "Contacts",
                 "Organizations", "Favors", "Doctor", "Jobs", "Legal", "Nav. Quiz"),
  "IPL-12" = c(
    round(cor(df$ipl12s, df$connectionHc), digits = 2),
    round(cor(df$ipl12s, df$outsider), digits = 2),
    NA,
    NA,
    round(cor(df$ipl12s, df$read), digits = 2),
    round(cor(df$ipl12s, df$speak), digits = 2),
    NA,
    NA,
    round(cor(df$ipl12s, df$income), digits = 2),
    round(cor(df$ipl12s, df$employment3cat), digits = 2),
    NA,
    NA,
    round(cor(df$ipl12s, df$polUnderstanding), digits = 2),
    round(cor(df$ipl12s, df$polDiscuss), digits = 2),
    NA,
    NA,
    round(cor(df$ipl12s, df$dinner), digits = 2),
    round(cor(df$ipl12s, df$contactsInUsCat2), digits = 2),
    NA,
    NA,
    round(cor(df$ipl12s, df$seeDoctor), digits = 2),
    round(cor(df$ipl12s, df$findJobs), digits = 2),
    NA,
    NA
  ),
  "IPL-24" = c(
    round(cor(df$ipl24s, df$connectionHc), digits = 2),
    round(cor(df$ipl24s, df$outsider), digits = 2),
    round(cor(df$ipl24s, df$futureHc), digits = 2),
    round(cor(df$ipl24s, df$isolation), digits = 2),
    round(cor(df$ipl24s, df$read), digits = 2),
    round(cor(df$ipl24s, df$speak), digits = 2),
    round(cor(df$ipl24s, df$write), digits = 2),
    round(cor(df$ipl24s, df$listen), digits = 2),
    round(cor(df$ipl24s, df$income), digits = 2),
    round(cor(df$ipl24s, df$employment3cat), digits = 2),
    round(cor(df$ipl24s, df$expenses), digits = 2),
    round(cor(df$ipl24s, df$emplSatisfied), digits = 2),
    round(cor(df$ipl24s, df$polUnderstanding), digits = 2),
    round(cor(df$ipl24s, df$polDiscuss), digits = 2),
    round(cor(df$ipl24s, df$polQuiz), digits = 2),
    round(cor(df$ipl24s, df$polAction), digits = 2),
    round(cor(df$ipl24s, df$dinner), digits = 2),
    round(cor(df$ipl24s, df$contactsInUsCat2), digits = 2),
    round(cor(df$ipl24s, df$maxOrg), digits = 2),
    round(cor(df$ipl24s, df$favors), digits = 2),
    round(cor(df$ipl24s, df$seeDoctor), digits = 2),
    round(cor(df$ipl24s, df$findJobs), digits = 2),
    round(cor(df$ipl24s, df$legalProblems), digits = 2),
    round(cor(df$ipl24s, df$AdDTM), digits = 2)
  )
)

stargazer(correlations,
          title = c("Correlations between individual questions and Integration Indexes"),
          summary = FALSE,
          rownames = FALSE,
          align = TRUE,
          out = c(here::here("Draft/PNAS/draft/tables", "correlations.tex")))
